import { IRouteComponentProps } from 'umi'

import TeacherLayout from "./teacherLayout"
import StudentsLayout from "./studentsLayout"

const Layout:React.FC<IRouteComponentProps>=props=>{
    
    if (/\/teachers/.test(props.location.pathname)) {
        // return props.children
        return <TeacherLayout>{props.children}</TeacherLayout>
    }
    if (/\/students/.test(props.location.pathname)) {
        // return props.children
        return <StudentsLayout>{props.children}</StudentsLayout>
    }

    return props.children
}

export default Layout